﻿@using yeubongda
@using yeubongda.Models

@{
    ViewBag.Title = "TimNangCao";
    Layout = "~/Views/Shared/_Layout.cshtml";

    List<LOAI> list = ViewBag.listLoai;
    
    // tao list nap vao drop down list
    List<SelectListItem> listLoai = new List<SelectListItem>();
    for(int i=0; i < list.Count;++i)
    {
        SelectListItem thItem = new SelectListItem();
        thItem.Text = list[i].tenloai;
        thItem.Value = list[i].maloai.ToString();

        listLoai.Add(thItem);    
    }

    SelectListItem firstItem = new SelectListItem();
    firstItem.Text = "-- Tất cả --";
    firstItem.Value = "0";
    listLoai.Insert(0, firstItem);
}

<div class="center_title_bar">Thông tin tìm kiếm </div><br />
@using (Html.BeginForm("TimNangCao", "Home"))
{
    <span> Tên sản phẩm </span> @Html.TextBox("txtTenBB") <br /> 
    <span> Từ ngày </span> @Html.TextBox("txtTuNgay") <span>đến </span>@Html.TextBox("txtDenNgay") <br />
    <span > Loại </span>
    @Html.DropDownList("cmbLoai", listLoai)
    <Br />
    <input type="submit" name="btnTim" value="Tìm" />
}

@{
    IEnumerable<BAIBAO> listKQ = ViewBag.listKQ;
}    
    @if (listKQ != null && listKQ.Count() > 0)
    {



        for (int i = 0; i < listKQ.Count(); ++i)
        {
            BAIBAO bb = listKQ.ElementAt(i);
    	<div class="prod_box">
        	<div class="top_prod_box"></div>
            <div class="center_prod_box">            
                 <div class="product_title">
                    <a href="@Url.Content("~/Home/BaiBaoDetail/" + bb.MABAI)">@bb.TENBAI</a></div>
                 <div class="product_img"><a href="details.html">
                    <img src="@Url.Content("~/Content/images/" + bb.hinhanh)" 
                        alt="" title="" border="0" 
                        width="100" height="120"
                        /></a></div>
                 <div class="prod_price"> 
                 <span >@bb.Ngay</span></div>                        
            </div>
            <div class="bottom_prod_box"></div>             
            <div class="prod_details_tab">
            <a href="@Url.Content("~/Home/BaiBaoDetail/" + bb.MABAI)" class="prod_details">Xem</a>            
            </div>                     
        </div>
    }
    

    } 

